package com.scse.bms.service;

import com.scse.bms.mapper.DownloadMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Title: DownloadServiceImpl
 * @Author: 吴赠禹
 * @Date: 2021/2/24 21:06
 * @Version: 1.0
 * @Description: TODO
 */


@Service
@Transactional(rollbackFor = Exception.class)
public class DownloadServiceImpl implements DownloadService {


    @Autowired
    private DownloadMapper downloadMapper;

    @Override
    public int save(Integer userId, Integer bookId, Integer themeId) {
        return downloadMapper.insertDownload(userId, bookId, themeId);
    }

    @Override
    public Integer getDownCountByToday(Integer userId) {
        return downloadMapper.selectDownCountByToday(userId);
    }
}
